﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package scripting {

    public class Script {

        protected var m_conditions:ConditionSet;
        protected var m_context:IScriptingContext;

        public function Script(_arg1:IScriptingContext){
            this.m_context = _arg1;
            this.m_conditions = new ConditionSet();
        }
        public function validates():Boolean{
            if (this.m_conditions.evaluate()){
                this.m_context.onValidate();
                return (true);
            };
            return (false);
        }
        public function addCondition(_arg1:String, _arg2:Object=null):void{
            var _local3:Function = Global.scriptingManager.getConditionFunction(_arg1, this.m_context);
            if (_local3 != null){
                this.m_conditions.add(new Condition(_local3, _arg2));
            };
        }

    }
}//package scripting 
